//
// Created by zhulingfeng on 2020/2/8.
//

#include "create_binary_tree_test.hpp"

CreateBinaryTreeTest::CreateBinaryTreeTest() {
  level_order_strings_ = {"#",   "1",     "1##",   "12#",   "1#2",
                          "123", "12##3", "12345", "123#45"};
  pre_order_strings_ = {"#",     "1",    "1##",       "12",      "1#2",
                        "12##3", "12#3", "124##5##3", "12#4##35"};
  post_order_strings_ = {"#",       "##1",     "##1",         "##2#1",    "#21",
                         "##2##31", "###32#1", "##4##52##31", "#4##25#31"};
  level_order_gts_ = {{},
                      {1},
                      {1},
                      {1, 2},
                      {1, 2},
                      {1, 2, 3},
                      {1, 2, 3},
                      {1, 2, 3, 4, 5},
                      {1, 2, 3, 4, 5}};
  pre_order_gts_ = {{},
                    {1},
                    {1},
                    {1, 2},
                    {1, 2},
                    {1, 2, 3},
                    {1, 2, 3},
                    {1, 2, 4, 5, 3},
                    {1, 2, 4, 3, 5}};
  in_order_gts_ = {{},
                   {1},
                   {1},
                   {2, 1},
                   {1, 2},
                   {2, 1, 3},
                   {2, 3, 1},
                   {4, 2, 5, 1, 3},
                   {2, 4, 1, 5, 3}};
  post_order_gts_ = {{},
                     {1},
                     {1},
                     {2, 1},
                     {2, 1},
                     {2, 3, 1},
                     {3, 2, 1},
                     {4, 5, 2, 3, 1},
                     {4, 2, 5, 3, 1}};
  const auto n = level_order_strings_.size();
  assert(pre_order_strings_.size() == n);
  assert(post_order_strings_.size() == n);
  assert(level_order_gts_.size() == n);
  assert(pre_order_gts_.size() == n);
  assert(in_order_gts_.size() == n);
  assert(post_order_gts_.size() == n);

  level_order_strings_exception_data_ = {"a", "1,"};
  pre_order_exception_data_ = {{1, 2}, {1, 2, 3}, {1, 2, 3, 4, 5}};
  in_order_exception_data_ = {{1, 3}, {1, 2, 4}, {4, 2, 5, 3, 1}};
  pre_order_exception_data_.push_back({1, 2});
  in_order_exception_data_.push_back({2, 1, 1});
}
